Fix runfile cache location to survive dnx auto-pruning#60
Closed
Copilot wants to merge 2 commits into
Closed
Conversation
…clean on fresh dirs Agent-Logs-Url: https://github.com/devlooped/runfile/sessions/987fee84-cbad-4733-9b02-d72ab228d677 Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error when dotnet runfile prunes unused directories
Fix runfile cache location to survive dnx auto-pruning
May 3, 2026
Member
|
Superseded by #62 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dnx(the .NET 10+ built-in tool runner) periodically prunes its working directories under%TEMP%. Becauserunfilecached downloaded repos under%TEMP%\dotnet\runfile\, those directories were being deleted mid-session, causingdotnet runto fail with aNullReferenceExceptioninLockFile.GetTargetand a "path not found" error when MSBuild tried to enumerate files in the now-deleted directory.Changes
RemoteRefExtensions.cs—GetTempRoot()now usesLocalApplicationDataon all platforms instead ofPath.GetTempPath()on Windows. This moves the cache fromAppData\Local\Temp\dotnet\runfile\toAppData\Local\dotnet\runfile\, outsidednx's cleanup scope. Linux/Mac already usedLocalApplicationData; this aligns Windows with the same behaviour. Drops the now-unusedRuntimeInformation/OSPlatformimport.RemoteRunner.cs—dotnet cleanis now skipped when theobj/directory doesn't exist.ExtractToAsyncalways deletes the entire temp directory before re-extracting, soobj/is never present after a fresh extraction. Runningdotnet cleanagainst a directory with noobj/can produce a corruptedproject.assets.json, which then causes the sameNullReferenceExceptionon the nextdotnet run.